/*
 * geometry.c
 *
 *  Created on: 07/06/2009
 *      Author: kimi
 */
#include <math/geometry.h>

void createRectangle(Rect *r, unsigned char x, unsigned char y,
		unsigned char w, unsigned char h) {
	r->p1.x = x;
	r->p1.y = y;
	r->p2.x = x + w;
	r->p2.y = y + h;
}

void createCircle(Circle *c, unsigned char x, unsigned char y,
		unsigned char rad) {
	c->center.x = x;
	c->center.y = y;
	c->radius = rad;
}

void createTriangle(Triangle *t, unsigned char x1, unsigned char y1,
		unsigned char x2, unsigned char y2, unsigned char x3, unsigned char y3) {

	t->p1.x = x1;
	t->p1.y = y1;
	t->p2.x = x2;
	t->p2.y = y2;
	t->p3.x = x3;
	t->p3.y = y3;
}
